/*************************************************************************
	> File Name: P8772.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2025-01-14 11:25:24
 ************************************************************************/

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    long long n, ans = 0, sum = 0;
    cin >> n;
    for (int i = 1, x; i <= n; i++) {
        cin >> x;
        sum += (x * x);
        ans += x;
    }
    cout << (ans * ans - sum) / 2 << endl;
    return 0;
}
